
namespace glf {

void* Memset16(void* ptr, unsigned short value, size_t num) {
	unsigned short* data = static_cast<unsigned short*>(ptr);
	
	while(num--) *data++ = value;

	return ptr;
}

void* Memset32(void * ptr, unsigned int value, size_t num)
{ 
	unsigned int* data = static_cast<unsigned int*>(ptr);
	
	while(num--) *data++ = value;

	return ptr;
}

#ifndef GLF_HAS_MEMSET

void* Memset(void* p, int val, unsigned int count) {
	char* buf = static_cast<char*>(p);
	for(uint i = 0; i < count; ++i) {
		buf[i] = 0;
	}

	return p;
}

#define GLF_HAS_MEMSET
#endif

} //namespace glf

